package com.wwt.server.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 公共返回对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private String message;
    private Integer code;
    private Object obj;
    public static Result success(String message){
        return new Result(message,200,null);
    }
    public static Result success(String message,Object data){
        return new Result(message,200,data);
    }
    public static Result fail(String message,Integer code){
        return new Result(message,code,null);
    }
    public static Result fail(String message,Integer code,Object data){
        return new Result(message,code,data);
    }
    public static Result fail(String message){
        return new Result(message,null,null);
    }

}
